﻿using System;
using System.Diagnostics;
using System.IO;
using System.Windows.Forms;

namespace CDude.Vita
{
    internal class VitaCOMlauncher
    {
        private static void Main(string[] args)
        {
            if (Environment.GetEnvironmentVariable("SCE_PSM_SDK") == null)
            {
                MessageBox.Show("Could not find PSM install path. Make sure the PlayStation Mobile SDK is installed on your computer.", "Error! – VitaCOMgui", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Console.ReadKey(true);
                Environment.Exit(0);
            }

            string vitacompath = Path.Combine(Environment.GetEnvironmentVariable("SCE_PSM_SDK"), "tools\\PsmStudio\\AddIns\\MonoDevelop.Psm\\VitaCOMgui.exe");
            if (!File.Exists(vitacompath))
                File.WriteAllBytes(vitacompath, Resources.VitaCOMgui);

            Process vitacomgui = new Process()
            {
                StartInfo = new ProcessStartInfo(vitacompath)
                {
                    
                }
            };
            vitacomgui.Start();
        }
    }
}